using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using SailHero.Soft.FrameWork.Models;

namespace SailHero.Soft.FrameWork.Mapping.HJT212DB
{
    public class TB_HOSTCLIENTSMap : EntityTypeConfiguration<TB_HOSTCLIENTS>
    {
        public TB_HOSTCLIENTSMap()
        {
            // Primary Key
            this.HasKey(t => t.ID);

            // Properties
            this.Property(t => t.ID)
                .IsRequired()
                .HasMaxLength(32);

            this.Property(t => t.MN)
                .HasMaxLength(20);

            this.Property(t => t.MCNNAME)
                .HasMaxLength(20);

            this.Property(t => t.PW)
                .HasMaxLength(20);

            this.Property(t => t.ParentID)
                .HasMaxLength(32);

            // Table & Column Mappings
            this.ToTable("TB_HOSTCLIENTS");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.MN).HasColumnName("MN");
            this.Property(t => t.MCNNAME).HasColumnName("MCNNAME");
            this.Property(t => t.PW).HasColumnName("PW");
            this.Property(t => t.ONLINESTATE).HasColumnName("ONLINESTATE");
            this.Property(t => t.DT).HasColumnName("DT");
            this.Property(t => t.ParentID).HasColumnName("ParentID");
            this.Property(t => t.IsLeaf).HasColumnName("IsLeaf");
        }
    }
}
